package pers.yurwisher.rubick.common.enums.tip;

import pers.yurwisher.rubick.common.enums.ICustomTipEnum;
import pers.yurwisher.rubick.common.wrapper.CustomTip;

/**
 * @author yq
 * @date 2020/09/18 09:54
 * @description 系统服务 自定义提示枚举
 * @since V1.0.0
 */
public enum SystemCustomTipEnum implements ICustomTipEnum {
    /**帐号或密码错误*/

    AUTH_CODE_NOT_EXIST_OR_EXPIRED(10005,"验证码已过期"),
    AUTH_CODE_ERROR(10006,"验证码错误"),
    USERNAME_EXISTED(10007,"用户名已被使用"),
    PHONE_EXISTED(10008,"手机已注册"),

    MENU_I_FRAME_PATH_PREFIX_ERROR("iFrame菜单路由地址必须以http/https开头"),
    MENU_PID_NOT_ID("上级不能为自己"),
    MENU_COMPONENT_NOT_BE_NULL("菜单component不可为空"),

    CONFIG_CODE_EXISTED("配置编码已存在"),
    CONFIG_CODE_NOT_EXISTED("配置编码[%s]不存在"),

    DICT_FIXED_NOT_CHANGE("固定字典不可修改"),
    DICT_TYPE_EXISTED("字典类型已存在"),
    AUTH_TWO_PASS_NOT_EQUAL("新密码与确认密码不一致"),
    AUTH_OLD_PASS_ERROR("旧密码错误"),
    AUTH_NEW_MAIL_EQUAL_OLD("新邮箱与旧邮箱不能相同"),
    AUTH_CURRENT_PASS_ERROR("帐号密码错误"),
    AUTH_NEW_PHONE_EQUAL_OLD("新手机与旧手机不能相同"),

    QUERY_PAGE_SIZE_OVER_MAX("单页查询超出最大数量"),

    FILE_UPLOAD_ERROR("上传文件失败"),
    FILE_NOT_EXIST("%s 不存在"),
    FILE_DOWNLOAD_ERROR("文件下载失败,稍后重试"),
    IMPORT_DATA_ERROR("第[%s]行[%s]列导入异常: %s"),
    IMPORT_DATA_ERROR_FOR_ROW("第[%s]行导入数据异常"),

    INVALID_CLIENT(1012,"无效客户端"),
    ERROR_CLIENT_SECRET(1012,"客户端密码错误"),
    AUTH_USERNAME_OR_PASSWORD_ERROR(10001,"帐号或密码错误"),
    REQUIRE_USERNAME_AND_PASSWORD("帐号或密码必填"),
    AUTH_USERNAME_FORBIDDEN(10002,"帐号已被禁用"),
    REFRESH_CREDENTIALS_INVALID(1010, "刷新凭证无效或已过期"),
    REQUIRE_REFRESH_CREDENTIALS("刷新凭证必填"),
    PERMISSION_DENIED(10003,"无权访问"),
    CREDENTIALS_INVALID(10004,"凭证无效或已过期"),
    ;

    private CustomTip tip;

    SystemCustomTipEnum(int code, String msg) {
        this.tip = CustomTip.of(code, msg);
    }

    SystemCustomTipEnum(String msg) {
        this.tip = CustomTip.error(msg);
    }

    @Override
    public CustomTip tip() {
        return tip;
    }


}
